Optimal. Leaf size=167 \[ a^3 A x+\frac {b \left (12 a^2 (2 A+C)+b^2 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a \left (6 A b^2+\left (a^2+4 b^2\right ) C\right ) \tan (c+d x)}{2 d}+\frac {b \left (2 a^2 C+b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 167, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 6, integrand size = 25, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.240, Rules used = {4142, 4141,
4133, 3855, 3852, 8} \begin {gather*} a^3 A x+\frac {a \left (C \left (a^2+4 b^2\right )+6 A b^2\right ) \tan (c+d x)}{2 d}+\frac {b \left (12 a^2 (2 A+C)+b^2 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \left (2 a^2 C+b^2 (4 A+3 C)\right ) \tan (c+d x) \sec (c+d x)}{8 d}+\frac {a C \tan (c+d x) (a+b \sec (c+d x))^2}{4 d}+\frac {C \tan (c+d x) (a+b \sec (c+d x))^3}{4 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4133
Rule 4141
Rule 4142
Rubi steps
\begin {align*} \int (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{4} \int (a+b \sec (c+d x))^2 \left (4 a A+b (4 A+3 C) \sec (c+d x)+3 a C \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a C (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{12} \int (a+b \sec (c+d x)) \left (12 a^2 A+3 a b (8 A+5 C) \sec (c+d x)+3 \left (2 a^2 C+b^2 (4 A+3 C)\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {b \left (2 a^2 C+b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{24} \int \left (24 a^3 A+3 b \left (12 a^2 (2 A+C)+b^2 (4 A+3 C)\right ) \sec (c+d x)+12 a \left (6 A b^2+\left (a^2+4 b^2\right ) C\right ) \sec ^2(c+d x)\right ) \, dx\\ &=a^3 A x+\frac {b \left (2 a^2 C+b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {1}{2} \left (a \left (6 A b^2+\left (a^2+4 b^2\right ) C\right )\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{8} \left (b \left (12 a^2 (2 A+C)+b^2 (4 A+3 C)\right )\right ) \int \sec (c+d x) \, dx\\ &=a^3 A x+\frac {b \left (12 a^2 (2 A+C)+b^2 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {b \left (2 a^2 C+b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {\left (a \left (6 A b^2+\left (a^2+4 b^2\right ) C\right )\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{2 d}\\ &=a^3 A x+\frac {b \left (12 a^2 (2 A+C)+b^2 (4 A+3 C)\right ) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {a \left (6 A b^2+\left (a^2+4 b^2\right ) C\right ) \tan (c+d x)}{2 d}+\frac {b \left (2 a^2 C+b^2 (4 A+3 C)\right ) \sec (c+d x) \tan (c+d x)}{8 d}+\frac {a C (a+b \sec (c+d x))^2 \tan (c+d x)}{4 d}+\frac {C (a+b \sec (c+d x))^3 \tan (c+d x)}{4 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(1241\) vs. \(2(167)=334\).
time = 6.43, size = 1241, normalized size = 7.43 \begin {gather*} \frac {2 a^3 A (c+d x) \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right )}{d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x))}+\frac {\left (-24 a^2 A b-4 A b^3-12 a^2 b C-3 b^3 C\right ) \cos ^5(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right )}{4 d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x))}+\frac {\left (24 a^2 A b+4 A b^3+12 a^2 b C+3 b^3 C\right ) \cos ^5(c+d x) \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right ) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right )}{4 d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x))}+\frac {b^3 C \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right )}{8 d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}+\frac {\left (4 A b^3+12 a^2 b C+4 a b^2 C+3 b^3 C\right ) \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right )}{8 d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {a b^2 C \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \sin \left (\frac {1}{2} (c+d x)\right )}{d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}-\frac {b^3 C \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right )}{8 d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^4}+\frac {a b^2 C \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \sin \left (\frac {1}{2} (c+d x)\right )}{d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^3}+\frac {\left (-4 A b^3-12 a^2 b C-4 a b^2 C-3 b^3 C\right ) \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right )}{8 d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )^2}+\frac {2 \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \left (3 a A b^2 \sin \left (\frac {1}{2} (c+d x)\right )+a^3 C \sin \left (\frac {1}{2} (c+d x)\right )+2 a b^2 C \sin \left (\frac {1}{2} (c+d x)\right )\right )}{d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )}+\frac {2 \cos ^5(c+d x) (a+b \sec (c+d x))^3 \left (A+C \sec ^2(c+d x)\right ) \left (3 a A b^2 \sin \left (\frac {1}{2} (c+d x)\right )+a^3 C \sin \left (\frac {1}{2} (c+d x)\right )+2 a b^2 C \sin \left (\frac {1}{2} (c+d x)\right )\right )}{d (b+a \cos (c+d x))^3 (A+2 C+A \cos (2 c+2 d x)) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.11, size = 209, normalized size = 1.25 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 254, normalized size = 1.52 \begin {gather*} \frac {16 \, {\left (d x + c\right )} A a^{3} + 16 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a b^{2} - C b^{3} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, C a^{2} b {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 4 \, A b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a^{2} b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) + 16 \, C a^{3} \tan \left (d x + c\right ) + 48 \, A a b^{2} \tan \left (d x + c\right )}{16 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.68, size = 199, normalized size = 1.19 \begin {gather*} \frac {16 \, A a^{3} d x \cos \left (d x + c\right )^{4} + {\left (12 \, {\left (2 \, A + C\right )} a^{2} b + {\left (4 \, A + 3 \, C\right )} b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (12 \, {\left (2 \, A + C\right )} a^{2} b + {\left (4 \, A + 3 \, C\right )} b^{3}\right )} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (8 \, C a b^{2} \cos \left (d x + c\right ) + 2 \, C b^{3} + 8 \, {\left (C a^{3} + {\left (3 \, A + 2 \, C\right )} a b^{2}\right )} \cos \left (d x + c\right )^{3} + {\left (12 \, C a^{2} b + {\left (4 \, A + 3 \, C\right )} b^{3}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{16 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (A + C \sec ^{2}{\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{3}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 526 vs.
\(2 (157) = 314\).
time = 0.50, size = 526, normalized size = 3.15 \begin {gather*} \frac {8 \, {\left (d x + c\right )} A a^{3} + {\left (24 \, A a^{2} b + 12 \, C a^{2} b + 4 \, A b^{3} + 3 \, C b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - {\left (24 \, A a^{2} b + 12 \, C a^{2} b + 4 \, A b^{3} + 3 \, C b^{3}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (8 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 12 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 24 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 4 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 5 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 24 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 12 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 72 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 40 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 4 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 24 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 12 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 72 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 40 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 4 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 3 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 8 \, C a^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 12 \, C a^{2} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, A a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 24 \, C a b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, A b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 5 \, C b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.03, size = 1547, normalized size = 9.26 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________